<template>
  <d2-container>
    <div class="muse_table_box">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="nickName" label="昵称" />
        <!-- <el-table-column prop="gender" label="性别" width="60">
                    <template slot-scope="scope">
                        {{ scope.row.gender | genderFormat }}
                    </template>
                </el-table-column> -->
        <el-table-column prop="cellphone" label="手机号" />
        <!-- <el-table-column prop="" label="已消费门店"/> -->
        <el-table-column prop="createdAt" label="创建时间">
          <template slot-scope="scope">
            {{ scope.row.createdAt | date("YYYY-MM-DD HH:mm") }}
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        class="muse_pagination"
        :background="true"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="paging.page"
        :page-sizes="paging.pageSizeAry"
        :page-size="paging.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="paging.total"
      ></el-pagination>
    </div>
  </d2-container>
</template>

<script>
import tableMixin from "../mixins/tableMixin";
import { newMemberGivePointList } from "@/api/admin";
export default {
  name: "givePointList",
  mixins: [tableMixin],
  data() {
    return {};
  },
  created() {
    this.getTableData();
  },
  methods: {
    // 获取列表数据
    async getTableData(value, type) {
      let params = {
        page:
          type === "page"
            ? value
              ? value
              : this.paging.page
            : this.paging.page,
        pageSize:
          type === "pageSize"
            ? value
              ? value
              : this.paging.pageSize
            : this.paging.pageSize,
      };
      params = Object.assign({}, params, this.form);
      const {
        code,
        data: { total, currentPage, data, pageSize },
      } = await newMemberGivePointList(params);
      this.paging.total = total;
      this.paging.pageSize = pageSize;
      this.paging.page = currentPage;
      this.tableData = data;
    },
  },
};
</script>

<style scoped>
</style>
